from django.http import HttpResponse
from django.shortcuts import redirect, reverse

# Create your views here.


def index(request):
    username = request.GET.get('username')
    if username:
        return HttpResponse('CMS首页')
    else:
        app_namespace = request.resolver_match.namespace
        print('*' * 20)
        print(app_namespace)
        print('*' * 20)
        return redirect(reverse('%s:login' % app_namespace))


def login(request):
    return HttpResponse('CMS登录')
